home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / shells / tcshsrc.zoo / tcsh / sh.char.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-11  |  10.1 KB  |  319 lines

  1. /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.char.c,v 3.1 1991/07/15 19:37:24 christos Exp $ */
  2. /*
  3.  * sh.char.c: Character classification tables
  4.  */
  5. /*-
  6.  * Copyright (c) 1980, 1991 The Regents of the University of California.
  7.  * All rights reserved.
  8.  *
  9.  * Redistribution and use in source and binary forms, with or without
  10.  * modification, are permitted provided that the following conditions
  11.  * are met:
  12.  * 1. Redistributions of source code must retain the above copyright
  13.  *    notice, this list of conditions and the following disclaimer.
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in the
  16.  *    documentation and/or other materials provided with the distribution.
  17.  * 3. All advertising materials mentioning features or use of this software
  18.  *    must display the following acknowledgement:
  19.  *    This product includes software developed by the University of
  20.  *    California, Berkeley and its contributors.
  21.  * 4. Neither the name of the University nor the names of its contributors
  22.  *    may be used to endorse or promote products derived from this software
  23.  *    without specific prior written permission.
  24.  *
  25.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  26.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  27.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  28.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  29.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  31.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  32.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  33.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  34.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  35.  * SUCH DAMAGE.
  36.  */
  37. #include "config.h"
  38. RCSID("$Id: sh.char.c,v 3.1 1991/07/15 19:37:24 christos Exp $")
  39.  
  40. #include "sh.char.h"
  41.  
  42. unsigned short _cmap[256] = {
  43. /*    nul        soh        stx        etx    */
  44.     _CTR,        _CTR,        _CTR,        _CTR,
  45.  
  46. /*    eot        enq        ack        bel    */
  47.     _CTR,        _CTR,        _CTR,        _CTR,
  48.  
  49. /*    bs        ht        nl        vt    */
  50.     _CTR,        _CTR|_SP|_META,    _CTR|_NL|_META,    _CTR,
  51.  
  52. #ifndef __MINT__
  53. /*    np        cr        so        si    */
  54.     _CTR,        _CTR,        _CTR,        _CTR,
  55. #else
  56. /*    np        cr        so        si    */
  57.     _CTR,        _CTR|_SP|_META,    _CTR,        _CTR,
  58. #endif
  59.  
  60. /*    dle        dc1        dc2        dc3    */
  61.     _CTR,        _CTR,        _CTR,        _CTR,
  62.  
  63. /*    dc4        nak        syn        etb    */
  64.     _CTR,        _CTR,        _CTR,        _CTR,
  65.  
  66. /*    can        em        sub        esc    */
  67.     _CTR,        _CTR,        _CTR,        _CTR,
  68.  
  69. /*    fs        gs        rs        us    */
  70.     _CTR,        _CTR,        _CTR,        _CTR,
  71.  
  72. /*    sp        !        "        #    */
  73.     _SP|_META,    0,        _Q,        _META,
  74.  
  75. /*    $        %        &        '    */
  76.     _DOL,        0,        _META|_CMD,    _Q,
  77.  
  78. /*    (        )        *        +    */
  79.     _META|_CMD,    _META,        _GLOB,        0,
  80.  
  81. /*    ,        -        .        /    */
  82.     0,        0,        0,        0,
  83.  
  84. /*    0        1        2        3    */
  85.     _DIG|_XD,    _DIG|_XD,    _DIG|_XD,    _DIG|_XD,
  86.  
  87. /*    4        5        6        7    */
  88.     _DIG|_XD,    _DIG|_XD,    _DIG|_XD,    _DIG|_XD,
  89.  
  90. /*    8        9        :        ;    */
  91.     _DIG|_XD,    _DIG|_XD,    0,        _META|_CMD,
  92.  
  93. /*    <        =        >        ?    */
  94.     _META,        0,        _META,        _GLOB,
  95.  
  96. /*    @        A        B        C    */
  97.     0,        _LET|_UP|_XD,    _LET|_UP|_XD,    _LET|_UP|_XD,
  98.  
  99. /*    D        E        F        G    */
  100.     _LET|_UP|_XD,    _LET|_UP|_XD,    _LET|_UP|_XD,    _LET|_UP,
  101.  
  102. /*    H        I        J        K    */
  103.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  104.  
  105. /*    L        M        N        O    */
  106.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  107.  
  108. /*    P        Q        R        S    */
  109.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  110.  
  111. /*    T        U        V        W    */
  112.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  113.  
  114. /*    X        Y        Z        [    */
  115.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _GLOB,
  116.  
  117. /*    \        ]        ^        _    */
  118.     _ESC,        0,        0,        0,
  119.  
  120. /*    `        a        b        c    */
  121.   _Q1|_GLOB|_CMD|_META,    _LET|_LOW|_XD,    _LET|_LOW|_XD,    _LET|_LOW|_XD,
  122.  
  123. /*    d        e        f        g    */
  124.     _LET|_LOW|_XD,    _LET|_LOW|_XD,    _LET|_LOW|_XD,    _LET|_LOW,
  125.  
  126. /*    h        i        j        k    */
  127.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  128.  
  129. /*    l        m        n        o    */
  130.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  131.  
  132. /*    p        q        r        s    */
  133.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  134.  
  135. /*    t        u        v        w    */
  136.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  137.  
  138. /*    x        y        z        {    */
  139.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _GLOB,
  140.  
  141. /*    |        }        ~        del    */
  142.     _META|_CMD,    0,        0,        _CTR,
  143.  
  144. #if defined(SHORT_STRINGS) && !defined(KANJI)
  145. /****************************************************************/
  146. /* 128 - 255 The below is supposedly ISO 8859/1            */
  147. /****************************************************************/
  148. /*    (undef)        (undef)        (undef)        (undef)        */
  149.     _CTR,        _CTR,        _CTR,        _CTR,
  150.  
  151. /*    (undef)        (undef)        (undef)        (undef)        */
  152.     _CTR,        _CTR,        _CTR,        _CTR,
  153.  
  154. /*    (undef)        (undef)        (undef)        (undef)        */
  155.     _CTR,        _CTR,        _CTR,        _CTR,
  156.  
  157. /*    (undef)        (undef)        (undef)        (undef)        */
  158.     _CTR,        _CTR,        _CTR,        _CTR,
  159.  
  160. /*    (undef)        (undef)        (undef)        (undef)        */
  161.     _CTR,        _CTR,        _CTR,        _CTR,
  162.  
  163. /*    (undef)        (undef)        (undef)        (undef)        */
  164.     _CTR,        _CTR,        _CTR,        _CTR,
  165.  
  166. /*    (undef)        (undef)        (undef)        (undef)        */
  167.     _CTR,        _CTR,        _CTR,        _CTR,
  168.  
  169. /*    (undef)        (undef)        (undef)        (undef)        */
  170.     _CTR,        _CTR,        _CTR,        _CTR,
  171.  
  172. /*    nobreakspace    exclamdown    cent        sterling    */
  173.     _SP,        0,        0,        0,
  174.  
  175. /*    currency    yen        brokenbar    section        */
  176.     0,        0,        0,        0,
  177.  
  178. /*    diaeresis    copyright    ordfeminine    guillemotleft    */
  179.     0,        0,        0,        0,
  180.  
  181. /*    notsign        hyphen        registered    macron        */
  182.     0,        0,        0,        0,
  183.  
  184. /*    degree        plusminus    twosuperior    threesuperior    */
  185.     0,        0,        0,        0,
  186.  
  187. /*    acute        mu        paragraph    periodcentered    */
  188.     0,        0,        0,        0,
  189.  
  190. /*    cedilla        onesuperior    masculine    guillemotright    */
  191.     0,        0,        0,        0,
  192.  
  193. /*    onequarter    onehalf        threequarters    questiondown    */
  194.     0,        0,        0,        0,
  195.  
  196. /*    Agrave        Aacute        Acircumflex    Atilde        */
  197.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  198.  
  199. /*    Adiaeresis    Aring        AE        Ccedilla    */
  200.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  201.  
  202. /*    Egrave        Eacute        Ecircumflex    Ediaeresis    */
  203.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  204.  
  205. /*    Igrave        Iacute        Icircumflex    Idiaeresis    */
  206.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  207.  
  208. /*    ETH        Ntilde        Ograve        Oacute        */
  209.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  210.  
  211. /*    Ocircumflex    Otilde        Odiaeresis    multiply    */
  212.     _LET|_UP,    _LET|_UP,    _LET|_UP,    0,
  213.  
  214. /*    Ooblique    Ugrave        Uacute        Ucircumflex    */
  215.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_UP,
  216.  
  217. /*    Udiaeresis    Yacute        THORN        ssharp        */
  218.     _LET|_UP,    _LET|_UP,    _LET|_UP,    _LET|_LOW,
  219.  
  220. /*    agrave        aacute        acircumflex    atilde        */
  221.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  222.  
  223. /*    adiaeresis    aring        ae        ccedilla    */
  224.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  225.  
  226. /*    egrave        eacute        ecircumflex    ediaeresis    */
  227.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  228.  
  229. /*    igrave        iacute        icircumflex    idiaeresis    */
  230.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  231.  
  232. /*    eth        ntilde        ograve        oacute        */
  233.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  234.  
  235. /*    ocircumflex    otilde        odiaeresis    division    */
  236.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    0,
  237.  
  238. /*    oslash        ugrave        uacute        ucircumflex    */
  239.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  240.  
  241. /*    udiaeresis    yacute        thorn        ydiaeresis    */
  242.     _LET|_LOW,    _LET|_LOW,    _LET|_LOW,    _LET|_LOW,
  243. #endif /* SHORT_STRINGS && !KANJI */
  244. };
  245.  
  246. #ifndef NLS
  247. /* _cmap_lower, _cmap_upper for ISO 8859/1 */
  248.  
  249. unsigned char _cmap_lower[256] = {
  250.     0000,    0001,    0002,    0003,    0004,    0005,    0006,    0007,
  251.     0010,    0011,    0012,    0013,    0014,    0015,    0016,    0017,
  252.     0020,    0021,    0022,    0023,    0024,    0025,    0026,    0027,
  253.     0030,    0031,    0032,    0033,    0034,    0035,    0036,    0037,
  254.     0040,    0041,    0042,    0043,    0044,    0045,    0046,    0047,
  255.     0050,    0051,    0052,    0053,    0054,    0055,    0056,    0057,
  256.     0060,    0061,    0062,    0063,    0064,    0065,    0066,    0067,
  257.     0070,    0071,    0072,    0073,    0074,    0075,    0076,    0077,
  258.     0100,    0141,    0142,    0143,    0144,    0145,    0146,    0147,
  259.     0150,    0151,    0152,    0153,    0154,    0155,    0156,    0157,
  260.     0160,    0161,    0162,    0163,    0164,    0165,    0166,    0167,
  261.     0170,    0171,    0172,    0133,    0134,    0135,    0136,    0137,
  262.     0140,    0141,    0142,    0143,    0144,    0145,    0146,    0147,
  263.     0150,    0151,    0152,    0153,    0154,    0155,    0156,    0157,
  264.     0160,    0161,    0162,    0163,    0164,    0165,    0166,    0167,
  265.     0170,    0171,    0172,    0173,    0174,    0175,    0176,    0177,
  266.     0200,    0201,    0202,    0203,    0204,    0205,    0206,    0207,
  267.     0210,    0211,    0212,    0213,    0214,    0215,    0216,    0217,
  268.     0220,    0221,    0222,    0223,    0224,    0225,    0226,    0227,
  269.     0230,    0231,    0232,    0233,    0234,    0235,    0236,    0237,
  270.     0240,    0241,    0242,    0243,    0244,    0245,    0246,    0247,
  271.     0250,    0251,    0252,    0253,    0254,    0255,    0256,    0257,
  272.     0260,    0261,    0262,    0263,    0264,    0265,    0266,    0267,
  273.     0270,    0271,    0272,    0273,    0274,    0275,    0276,    0277,
  274.     0340,    0341,    0342,    0343,    0344,    0345,    0346,    0347,
  275.     0350,    0351,    0352,    0353,    0354,    0355,    0356,    0357,
  276.     0360,    0361,    0362,    0363,    0364,    0365,    0366,    0327,
  277.     0370,    0371,    0372,    0373,    0374,    0375,    0376,    0337,
  278.     0340,    0341,    0342,    0343,    0344,    0345,    0346,    0347,
  279.     0350,    0351,    0352,    0353,    0354,    0355,    0356,    0357,
  280.     0360,    0361,    0362,    0363,    0364,    0365,    0366,    0367,
  281.     0370,    0371,    0372,    0373,    0374,    0375,    0376,    0377,
  282. };
  283.  
  284. unsigned char _cmap_upper[256] = {
  285.     0000,    0001,    0002,    0003,    0004,    0005,    0006,    0007,
  286.     0010,    0011,    0012,    0013,    0014,    0015,    0016,    0017,
  287.     0020,    0021,    0022,    0023,    0024,    0025,    0026,    0027,
  288.     0030,    0031,    0032,    0033,    0034,    0035,    0036,    0037,
  289.     0040,    0041,    0042,    0043,    0044,    0045,    0046,    0047,
  290.     0050,    0051,    0052,    0053,    0054,    0055,    0056,    0057,
  291.     0060,    0061,    0062,    0063,    0064,    0065,    0066,    0067,
  292.     0070,    0071,    0072,    0073,    0074,    0075,    0076,    0077,
  293.     0100,    0101,    0102,    0103,    0104,    0105,    0106,    0107,
  294.     0110,    0111,    0112,    0113,    0114,    0115,    0116,    0117,
  295.     0120,    0121,    0122,    0123,    0124,    0125,    0126,    0127,
  296.     0130,    0131,    0132,    0133,    0134,    0135,    0136,    0137,
  297.     0140,    0101,    0102,    0103,    0104,    0105,    0106,    0107,
  298.     0110,    0111,    0112,    0113,    0114,    0115,    0116,    0117,
  299.     0120,    0121,    0122,    0123,    0124,    0125,    0126,    0127,
  300.     0130,    0131,    0132,    0173,    0174,    0175,    0176,    0177,
  301.     0200,    0201,    0202,    0203,    0204,    0205,    0206,    0207,
  302.     0210,    0211,    0212,    0213,    0214,    0215,    0216,    0217,
  303.     0220,    0221,    0222,    0223,    0224,    0225,    0226,    0227,
  304.     0230,    0231,    0232,    0233,    0234,    0235,    0236,    0237,
  305.     0240,    0241,    0242,    0243,    0244,    0245,    0246,    0247,
  306.     0250,    0251,    0252,    0253,    0254,    0255,    0256,    0257,
  307.     0260,    0261,    0262,    0263,    0264,    0265,    0266,    0267,
  308.     0270,    0271,    0272,    0273,    0274,    0275,    0276,    0277,
  309.     0300,    0301,    0302,    0303,    0304,    0305,    0306,    0307,
  310.     0310,    0311,    0312,    0313,    0314,    0315,    0316,    0317,
  311.     0320,    0321,    0322,    0323,    0324,    0325,    0326,    0327,
  312.     0330,    0331,    0332,    0333,    0334,    0335,    0336,    0337,
  313.     0300,    0301,    0302,    0303,    0304,    0305,    0306,    0307,
  314.     0310,    0311,    0312,    0313,    0314,    0315,    0316,    0317,
  315.     0320,    0321,    0322,    0323,    0324,    0325,    0326,    0367,
  316.     0330,    0331,    0332,    0333,    0334,    0335,    0336,    0377,
  317. };
  318. #endif /* NLS */
  319.